home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / Sample Editors⁄Viewers / Draw Editor / Source / LinkCommands.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-11  |  4.1 KB  |  164 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Command.h
  3.  
  4.     Contains:    Link command Classes Definition
  5.  
  6.     Written by:    Mike Halpin
  7.     
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11. #ifndef _LINKCOMMANDS_
  12. #define _LINKCOMMANDS_
  13.  
  14. // -- DrawEditor Includes --
  15.  
  16. #ifndef _COMPILERDEFS_
  17. #include "CompDefs.h"
  18. #endif
  19.  
  20. #ifndef _DRAWEDITORCONSTANTS_
  21. #include "DrawEditorConstants.h"
  22. #endif
  23.  
  24. #ifndef _COMMAND_
  25. #include "Command.h"
  26. #endif
  27.  
  28. //=============================================================================
  29. // Forward Declarations
  30. //=============================================================================
  31. class DrawEditor;
  32. class CShape;
  33. class ODFacet;
  34. class CSelection;
  35. class COrderedList;
  36. class ODDragItemIterator;
  37. class CSubscribeLink;
  38. class CPublishLink;
  39. class ODStorageUnit;
  40.  
  41. //=============================================================================
  42. // CPasteLinkCommand
  43. //=============================================================================
  44.  
  45. class CPasteLinkCommand : public CCommand
  46. {
  47. public:
  48.     CPasteLinkCommand(    DrawEditor* theEditor, 
  49.                                         CSelection* selection,
  50.                                         ODStorageUnit* contentSU,
  51.                                         ODPasteAsResult& paResult,
  52.                                         ODBoolean defaultIsMerge);
  53.     virtual ~CPasteLinkCommand();
  54.  
  55.     virtual void Commit(Environment* ev, ODDoneState state);    
  56.     virtual void DoCommand(Environment* ev);
  57.     virtual void RedoCommand(Environment* ev);
  58.     virtual void UndoCommand(Environment* ev);
  59.     
  60.     virtual void SetUpdateParameters();
  61.     virtual void CompleteLink(Environment* ev);
  62.     virtual void AbortLink(Environment* ev);
  63.     
  64.  
  65.     
  66. private:
  67.     CSelection*            fSelection;  // The actual selection
  68.     ODPasteAsResult        fPaResult;
  69.     ODBoolean            fDefaultIsMerge;
  70.     ODBoolean            fForceEmbed;
  71.     ODStorageUnit*         fContentSU;
  72.  
  73. protected:    
  74.     CSubscribeLink*        fSubscribeLink;
  75. };
  76.  
  77. //=============================================================================
  78. // CDropLinkCommand
  79. //=============================================================================
  80.  
  81. class CDropLinkCommand : public CPasteLinkCommand
  82. {
  83. public:
  84.     CDropLinkCommand(    DrawEditor* theEditor, 
  85.                                         CSelection* selection,
  86.                                         ODStorageUnit* dropSU,
  87.                                         ODPoint dropPoint,
  88.                                         ODPasteAsResult& paResult,
  89.                                         ODBoolean defaultIsMerge);
  90.     virtual ~CDropLinkCommand();
  91.     
  92.     virtual void SetUpdateParameters();
  93.     virtual void CompleteLink(Environment* ev);
  94.     virtual void AbortLink(Environment* ev);
  95.  
  96. private:
  97.     ODPoint                fDropPoint;
  98.  
  99. };
  100.  
  101.  
  102. //=============================================================================
  103. // CBreakLinkCommand
  104. //=============================================================================
  105.  
  106. class CBreakLinkCommand : public CCommand
  107. {
  108. public:
  109.     CBreakLinkCommand(DrawEditor* theEditor, CSubscribeLink* link);
  110.     virtual ~CBreakLinkCommand();
  111.     
  112.     virtual void Commit(Environment* ev, ODDoneState state);
  113.     virtual void DoCommand(Environment* ev);
  114.     virtual void RedoCommand(Environment* ev);
  115.     virtual void UndoCommand(Environment* ev);
  116.     
  117. private:
  118.     CSubscribeLink* fSubscribeLink;
  119. };
  120.  
  121.  
  122. //=============================================================================
  123. // CBreakLinkSourceCommand
  124. //=============================================================================
  125.  
  126. class CBreakLinkSourceCommand : public CCommand
  127. {
  128. public:
  129.     CBreakLinkSourceCommand(DrawEditor* theEditor, CPublishLink* link);
  130.     virtual ~CBreakLinkSourceCommand();
  131.     
  132.     virtual void Commit(Environment* ev, ODDoneState state);
  133.     virtual void DoCommand(Environment* ev);
  134.     virtual void RedoCommand(Environment* ev);
  135.     virtual void UndoCommand(Environment* ev);
  136.     
  137. private:
  138.     CPublishLink*     fPublishLink;
  139.     ODBoolean        fHadCommandOutstanding;
  140. };
  141.  
  142.  
  143. //=============================================================================
  144. // CCreateLinkCommand
  145. //=============================================================================
  146.  
  147. class CCreateLinkCommand : public CCommand
  148. {
  149. public:
  150.     CCreateLinkCommand(DrawEditor* theEditor, CPublishLink* link);
  151.     virtual ~CCreateLinkCommand();
  152.     
  153.     virtual void Commit(Environment* ev, ODDoneState state);
  154.     virtual void DoCommand(Environment* ev);
  155.     virtual void RedoCommand(Environment* ev);
  156.     virtual void UndoCommand(Environment* ev);
  157.     
  158. private:
  159.     CPublishLink* fPublishLink;
  160. };
  161.  
  162.  
  163.  
  164. #endif